﻿
using DotNetCore.MyBlogApp.DataModel.m2m_middle;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Text;

namespace DotNetCore.MyBlogApp.DataModel
{
    
    public class Article
    {
        
        [Key]
        public Guid ArticleId { get; set; }

       
        public string ArticleTitle { get; set; }
       
        public string ArticleAuthor { get; set; }
        
        public DateTime ArticlePubTime { get; set; }
       
        public DateTime ArticleInTime { get; set; }
        
        public string ArticlePubIp { get; set; }
        
        public int ArticleClick { get; set; }
        
        public int ArticleType { get; set; }
      
        public string ArticleContent { get; set; }
        
        public bool IsTop { get; set; }
       
        public bool IsDelete { get; set; }

        [Timestamp]
        public byte[] Vsersion { get; set; }//版本标识

        //导航属性
       
        public Guid SysUserId { get; set; }
        public SysUser SysUser { get; set; }

       
        [Required(AllowEmptyStrings = true)]
        public Guid CateGoryId { get; set; }
        public ArticleCategory ArticleCategory { get; set; }//文章所属分类


        public ICollection<Article_ArticleTag> Article_ArticleTags { get; set; }//文章标签 多对多关系




        /// <summary>
        /// 构造函数
        /// </summary>
        public Article()
        {
            Article_ArticleTags = new List<Article_ArticleTag>();
            IsDelete = false;
            IsTop = false;
        }
    }
}
